package com.teamfractal.fracdustry.common.item;

import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;

import javax.annotation.Nonnull;
import java.util.List;

public class FDFoilItem extends Item {
    Boolean hasTooltip;
    String key;
    public FDFoilItem(Properties properties, Boolean hasTooltip, String tooltipTranslationKey) {
        super(properties);
        this.hasTooltip = hasTooltip;
        this.key = tooltipTranslationKey;
    }

    @Override
    public boolean isFoil(@Nonnull ItemStack itemstack) {
        return true;
    }

    @Override
    public void appendHoverText(@Nonnull ItemStack itemstack, Level world, @Nonnull List<Component> list, @Nonnull TooltipFlag flag) {
        if(hasTooltip){
            list.add(new TranslatableComponent(key));
        }
        super.appendHoverText(itemstack, world, list, flag);
    }


}
